/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import ProForm from '@ant-design/pro-form';
import { Card, Row, Typography, Space, Button } from 'antd';
import React from 'react';
import UploadImage from './uploadImage';
import { useAliappInfoItem } from '../_utils/useAliappInfoItem';
const { Text } = Typography;

const AliappInfoPersonal = () => {
  const { formRef, disabled, onFinish } = useAliappInfoItem();

  return (
    <Card bodyStyle={{ padding: 10 }}>
      <ProForm
        formRef={formRef}
        onFinish={onFinish}
        submitter={{
          render: () => {},
        }}
      >
        <ProForm.Item
          label={<Text strong>特殊资质（快宝合作协议 + 快宝营业执照/快递末端备案回执）</Text>}
          name='special_license_pic'
          rules={[{ required: true, message: '请上传特殊资质' }]}
        >
          <UploadImage defaultText='请上传特殊资质' maxCount={3} disabled={disabled} />
        </ProForm.Item>
        <ProForm.Item
          label={<Text strong>门头照</Text>}
          name='out_door_pic'
          rules={[{ required: true, message: '请上传门头照' }]}
        >
          <UploadImage defaultText='请上传门头照' disabled={disabled} />
        </ProForm.Item>
        {!disabled && (
          <Row justify='center' style={{ marginTop: 20 }}>
            <Space size='large'>
              <Button onClick={() => formRef.current?.resetFields()}>重置</Button>
              <Button type='primary' onClick={() => formRef.current?.submit()}>
                提交
              </Button>
            </Space>
          </Row>
        )}
      </ProForm>
    </Card>
  );
};

export default AliappInfoPersonal;
